package com.example.demo.Controller1;

import com.example.demo.model.Person;
import com.example.demo.model.Type;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;

@RestController
@RequestMapping("test")
public class TestController {

@Value("${demo.key}")
String key1;
    @Autowired
    public Type type;
    @Autowired
   public  Person person;

    @RequestMapping("aaa")
    public void fun(){
        System.out.println(person);
    }
    @RequestMapping("bbb")
    public void fun1(){
        System.out.println(type);
    }

    @PostConstruct
    public void fun2(){
        System.out.println(key1);
    }

}
